package com.luwanglin.eduservice.controller;


import com.luwanglin.commonutils.R;
import com.luwanglin.eduservice.entity.vo.CourseInfoVo;
import com.luwanglin.eduservice.service.EduCourseService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 课程 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2021-05-13
 */
@RestController
@RequestMapping("/admin/course")
public class testController {

    final
    EduCourseService courseService;

    public testController(EduCourseService courseService) {
        this.courseService = courseService;
    }

    @PostMapping("addCourseInfo")
    public R addCourseInfo(@RequestBody CourseInfoVo courseInfoVo) {
        String courseId = courseService.saveCourseInfo(courseInfoVo);

        return R.ok().data("courseId", courseId);
    }
}

